package com.baidu.health.controller;

import com.baidu.health.pojo.*;
import com.baidu.health.service.*;
import com.baidu.health.vo.UserEvaluating;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "评测中心")
public class RiviewController {
    @Autowired
    private TbAilmentService tbAilmentService;
    @Autowired
    private TbFactorService tbFactorService;
    @Autowired
    private TbAilmentFatorService tbAilmentFatorService;
    @Autowired
    private TbUserEvaluatingService tbUserEvaluatingService;
    @Autowired
    private TbQuestionnaireService tbQuestionnaireService;
    @Autowired
    private TbAskService tbAskService;
    @Autowired
    private TbAnswerService tbAnswerService;
    @Autowired
    private TbDiseasePaperService tbDiseasePaperService;
    @Autowired
    private TbExcelossService tbExcelossService;
    //疾病管理查询
    @ApiOperation("疾病管理的查询")
    @RequestMapping("/ailmentSelect")
    public ResultResponse ailmentSelect(@RequestBody TbAilment tbAilment){
    return tbAilmentService.ailmentSelect(tbAilment);
    }
    //疾病管理修改
    @ApiOperation("疾病管理的修改")
    @RequestMapping("/ailmentUpdate")
    public ResultResponse ailmentUpdate(@RequestBody TbAilment tbAilment){
    return tbAilmentService.ailmentUpdate(tbAilment);
    }
    //疾病管理新增
    @ApiOperation("疾病管理的新增")
    @RequestMapping("/ailmentInsert")
    public ResultResponse ailmentInsert(@RequestBody TbAilment tbAilment){
    return tbAilmentService.ailmentInsert(tbAilment);
    }
    //疾病删除
    @ApiOperation("疾病管理的删除")
    @RequestMapping("/ailmentDeleted/{ailmentId}")
    public ResultResponse ailmentDeleted(@PathVariable Integer ailmentId){
    return tbAilmentService.ailmentDeleted(ailmentId);
    }
    //风险因素管理的查询
    @ApiOperation("风险因素管理的查询")
    @RequestMapping("/factorSelect")
    public ResultResponse factorSelect(@RequestBody TbFactor tbFactor){
    return tbFactorService.factorSelect(tbFactor);
    }
    //风险因素管理的新增
    @ApiOperation("风险因素管理的新增")
    @RequestMapping("/factorInsert")
    public ResultResponse factorInsert(@RequestBody TbFactor tbFactor){
    return tbFactorService.factorInsert(tbFactor);
    }
    //风险因素管理的修改
    @ApiOperation("风险因素管理的修改")
    @RequestMapping("/factorUpdate")
    public ResultResponse factorUpdate(@RequestBody TbFactor tbFactor){
    return tbFactorService.factorUpdate(tbFactor);
    }
    //风险因素管理的删除
    @ApiOperation("风险因素管理的删除")
    @RequestMapping("/factorDeleted/{factorId}")
    public ResultResponse factorDeleted(@PathVariable Integer factorId){
    return tbFactorService.factorDeleted(factorId);
    }
    //风险因素管理的查询
    @ApiOperation("风险因素管理的查询")
    @RequestMapping("/ailmentFactorSelect")
    public ResultResponse ailmentFactorSelect(@RequestBody TbAilmentFator tbAilmentFator){
    return tbAilmentFatorService.ailmentFactorSelect(tbAilmentFator);
    }
    //风险因素管理的新增
    @ApiOperation("风险因素管理的新增")
    @RequestMapping("/ailmentFactorInsert")
    public ResultResponse ailmentFactorInsert(@RequestBody TbAilmentFator tbAilmentFator){
    return tbAilmentFatorService.ailmentFactorInsert(tbAilmentFator);
    }
    //风险因素管理的修改
    @ApiOperation("风险因素管理的修改")
    @RequestMapping("/ailmentFactorUpdate")
    public ResultResponse ailmentFactorUpdate(@RequestBody TbAilmentFator tbAilmentFator){
    return tbAilmentFatorService.ailmentFactorUpdate(tbAilmentFator);
    }
    //风险因素管理的删除
    @ApiOperation("风险因素管理的删除")
    @RequestMapping("/ailmentFactorDeleted/{riskId}")
    public ResultResponse ailmentFactorDeleted(@PathVariable Integer riskId){
    return tbAilmentFatorService.ailmentFactorDeleted(riskId);
    }
    //评测报告查询
    @ApiOperation("评测报告查询")
    @RequestMapping("/UserEvaluatingSelect")
    public ResultResponse UserEvaluatingSelect(@RequestBody TbUserEvaluating tbUserEvaluating){
    return tbUserEvaluatingService.UserEvaluatingSelect(tbUserEvaluating);
    }
    //评测报告删除
    @ApiOperation("评测报告删除")
    @RequestMapping("/UserEvaluatingDeleted/{evaluatingId}")
    public ResultResponse UserEvaluatingDeleted(@PathVariable Integer evaluatingId){
    return tbUserEvaluatingService.UserEvaluatingDeleted(evaluatingId);
    }
    //问卷查找
    @ApiOperation("问卷查找")
    @RequestMapping("/QuestionnaireSelect")
    public ResultResponse QuestionnaireSelect(@RequestBody TbQuestionnaire tbQuestionnaire){
    return tbQuestionnaireService.QuestionnaireSelect(tbQuestionnaire);
    }
    //问卷新增
    @ApiOperation("问卷新增")
    @RequestMapping("/QuestionnaireInsert")
    public ResultResponse QuestionnaireInsert(@RequestBody TbQuestionnaire tbQuestionnaire){
    return tbQuestionnaireService.QuestionnaireInsert(tbQuestionnaire);
    }
    //问卷修改
    @ApiOperation("问卷修改")
    @RequestMapping("/QuestionnaireUpdate")
    public ResultResponse QuestionnaireUpdate(@RequestBody TbQuestionnaire tbQuestionnaire){
    return tbQuestionnaireService.QuestionnaireUpdate(tbQuestionnaire);
    }
    //问卷删除
    @ApiOperation("问卷删除")
    @RequestMapping("/QuestionnaireDeleted/{evaluatingId}")
    public ResultResponse QuestionnaireDeleted(@PathVariable Integer evaluatingId){
    return tbQuestionnaireService.QuestionnaireDeleted(evaluatingId);
    }
    //题库查找
    @ApiOperation("题库查找")
    @RequestMapping("/askSelect")
    public ResultResponse askSelect(@RequestBody TbAsk tbAsk){
    return tbAskService.askSelect(tbAsk);
    }
    //题库新增
    @ApiOperation("题库新增")
    @RequestMapping("/askInsert")
    public ResultResponse askInsert(@RequestBody TbAsk tbAsk){
    return tbAskService.askInsert(tbAsk);
    }
    //题库修改
    @ApiOperation("题库修改")
    @RequestMapping("/askUpdate")
    public ResultResponse askUpdate(@RequestBody TbAsk tbAsk){
    return tbAskService.askUpdate(tbAsk);
    }
    //题库删除
    @ApiOperation("题库删除")
    @RequestMapping("/askDeleted/{askId}")
    public ResultResponse askDeleted(@PathVariable Integer askId){
    return tbAskService.askDeleted(askId);
    }
    //答案查找
    @ApiOperation("答案查找")
    @RequestMapping("/answerkSelect/{askId}")
    public ResultResponse answerSelect(@PathVariable Integer askId){
    return tbAnswerService.answerSelect(askId);
    }
    //答案新增
    @ApiOperation("答案新增")
    @RequestMapping("/answerkInsert")
    public ResultResponse answerInsert(@RequestBody TbAnswer tbAnswer){
    return tbAnswerService.answerInsert(tbAnswer);
    }
    //答案修改
    @ApiOperation("答案修改")
    @RequestMapping("/answerkUpdate")
    public ResultResponse answerUpdate(@RequestBody TbAnswer tbAnswer){
    return tbAnswerService.answerUpdate(tbAnswer);
    }
    //答案删除
    @ApiOperation("答案删除")
    @RequestMapping("/answerkDeleted/{answerId}")
    public ResultResponse answerDeleted(@PathVariable Integer answerId){
    return tbAnswerService.answerDeleted(answerId);
    }
    //进行评测首先要查看我们最后一次评测有没有
    @ApiOperation("生成评测id")
    @RequestMapping("/beginreviewSelect")
    public ResultResponse beginreviewSelect(@RequestBody TbUserEvaluating tbUserEvaluating){
        return tbUserEvaluatingService.beginreviewSelect(tbUserEvaluating);
    }
    //进行评测第二步，如果说选择进行上一次评测，那出来上一次评测的数据，若果没有走下面这个
    @ApiOperation("生成评测id")
    @RequestMapping("/beginreview")
    public ResultResponse beginreview(@RequestBody TbUserEvaluating tbUserEvaluating){
        return tbUserEvaluatingService.beginreview(tbUserEvaluating);
    }
    //第三步获取问题,只获取一个问题
    @ApiOperation("通过id来获取问题")
    @PostMapping("/getEvaluationAsk/{reviewId}")
    public ResultResponse getEvaluationAsk(@PathVariable Integer reviewId){
        return tbUserEvaluatingService.getEvaluationAsk(reviewId);
    }
    //第四步提交问题
    @ApiOperation("/提交单个的问题存入")
    @PostMapping("/getUserEvaluatingAsk")
    public ResultResponse getUserEvaluatingAsk(@RequestBody UserEvaluating userEvaluating){
    return tbUserEvaluatingService.getUserEvaluatingAsk(userEvaluating);
    }
    //第五步评测结束生成报告
    @ApiOperation("/评测报告结束")
    @PostMapping("/gettbuserEvaluatingInsert/{evaluatingId}")
    public ResultResponse gettbuserEvaluatingInsert(@PathVariable Integer evaluatingId){
        return tbUserEvaluatingService.gettbuserEvaluatingInsert(evaluatingId);
    }
    //评测报告详细界面
    @ApiOperation("/评测报告详细界面")
    @PostMapping("/getEvaluatingdetails/{evaluatingId}")
    public ResultResponse getEvaluatingdetails(@PathVariable Integer evaluatingId){
        return tbUserEvaluatingService.getEvaluatingdetails(evaluatingId);
    }
    //智能对话回答
    @ApiOperation("/智能对话回答")
    @PostMapping("/smartDialogueAnswer/{answerId}")
    public ResultResponse smartDialogueAnswer(@PathVariable Integer answerId){
        return tbDiseasePaperService.smartDialogueAnswer(answerId);
    }

    //excel存入的表
    @ApiOperation("/excel存入的表")
    @PostMapping("/excelossSelect")
    public ResultResponse excelossSelect(@RequestBody TbExceloss exceloss){
        return tbExcelossService.excelossSelect(exceloss);
    }

    //excel修改表名
    @ApiOperation("/excel存入的表")
    @PostMapping("/excelossUpdate")
    public ResultResponse excelossUpdate(@RequestBody TbExceloss exceloss){
        return tbExcelossService.excelossUpdate(exceloss);
    }

    //excel删除单个信息
    @ApiOperation("/excel存入的表")
    @PostMapping("/excelossDelete/{excelossId}")
    public ResultResponse excelossDelete(@PathVariable Integer excelossId){
        return tbExcelossService.excelossDelete(excelossId);
    }
}